import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
import { Product } from './product';

@Define.Table({ TableName: 'combogroupitem' })
export class ComboGroupItem extends EntityObjectType<ComboGroupItem> {
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    comboGroupId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    comboId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    productId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    productName: string;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DataLength: 10,
        DecimalPoint: 3,
        DefaultValue: 0,
    })
    productPrice: number;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DataLength: 10,
        DecimalPoint: 3,
        DefaultValue: 0,
    })
    qty: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    storeId: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;

    product: Product;
}